package mysql

import (
	"fmt"
	"gorm.io/driver/mysql"
	"gorm.io/gorm"
)

var Db *gorm.DB

func InitDb() (err error) {
	dsn := "root:123456@tcp(127.0.0.1:3306)/cs?charset=utf8mb4&parseTime=True&loc=Local"
	Db, err = gorm.Open(mysql.Open(dsn), &gorm.Config{})

	fmt.Printf("221111is%#v\n", Db)
	if err != nil {
		return err
	}
	return nil
}
